/*
 * @Description: 公益站点管理
 * @Author: 龙春雨
 * @Date: 2023-04-06 14:07:24
 */
import { CUSTOMER_TYPE } from '@/const/type';
export const tableOption = {
  ...window.$crudMixins.tableOptions,
  viewBtn: true,
  addBtn: true,
  editBtn: true,
  delBtn: true,
  labelWidth: 180,
  searchLabelWidth: 120,
  span: 24,
  dialogCustomClass: 'dialog-base',
  menuWidth: 140,
  column: [
    {
      label: '收容站类型',
      prop: 'type',
      type: 'radio',
      value: '1',
      hide: true,
      span: 12,
      row: true,
      dicData: [
        {
          label: '自营',
          value: '1',
        },
        {
          label: '合作',
          value: '2',
        },
      ],
    },
    // {
    //   label: '公益站编号',
    //   prop: 'code',
    //   addDisplay: false,
    //   row: true,
    //   span: 12,
    //   editDisabled: true,
    // },
    {
      label: '基地ID',
      fixed: true,
      prop: 'id',
      width: 100,
      editDisplay: false,
      addDisplay: false,
      viewDisplay: false,
    },
    {
      label: '爱心收容站',
      prop: 'name',
      search: true,
      maxlength: 20,
      fixed: true,
      width: 220,
      overHidden: true,
      span: 12,
      row: true,
      rules: [
        {
          required: true,
          message: '请输入爱心收容站名称',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '关联基地账号',
      prop: 'appUserId',
      row: true,
      overHidden: true,
      type: 'select',
      span: 12,
      filterable: true,
      clearable: true,
      editDisabled: true,
      hide: true,
      dicUrl: `/app/appuser/list/?name={{key}}`,
      props: {
        label: 'nickname',
        value: 'userId',
      },
      dicQuery: {
        type: CUSTOMER_TYPE.BASE_ACCOUNT,
      },
      rules: [
        {
          required: true,
          message: '请选择关联基地账号',
          trigger: 'change',
        },
      ],
      // dicUrl: '',
    },
    {
      label: '收容站图片',
      prop: 'files',
      span: 24,
      hide: true,
      row: true,
      type: 'upload',
      dialogCustomClass: 'dialog-base',
      // listType: 'picture-img',
      listType: 'picture-card',
      fileSize: 10 * 1024,
      fileType: 'img',
      accept: '.jpg,.png,.jpeg,.webp,.heic',
      propsHttp: {
        name: 'hash',
        url: 'key',
      },
      oss: 'qiniu',
      limit: 10,
      cropperOption: {
        fixed: true,
        enlarge: 2,
        fixedNumber: [3, 4],
      },
      rules: [
        {
          required: true,
          message: '请上传收容站图片',
          trigger: 'change',
        },
      ],
      tip: '请上传jpg/png/jpeg/webp/heic类型的文件，最大可上传10M',
    },
    {
      label: '收容站位置',
      prop: 'address',
      search: true,
      row: true,
      overHidden: true,
      span: 12,
      addDisplay: false,
      editDisplay: false,
    },

    {
      label: '收容站位置',
      prop: 'addressInfo',
      row: true,
      span: 12,
      viewDisplay: false,
      hide: true,
      // component: 'BMapAddressSelect',
      type: 'map',
      rules: [
        {
          required: true,
          message: '请选择收容站位置',
          trigger: 'change',
        },
      ],
    },
    {
      label: '收容站位置tag',
      prop: 'tag',
      search: true,
      maxlength: 10,
      row: true,
      fixed: true,
      width: 220,
      overHidden: true,
      span: 12,
      rules: [
        {
          required: true,
          message: '请输入收容站位置tag',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '收容站特色tag',
      prop: 'feature',
      maxlength: 10,
      row: true,
      span: 12,
      overHidden: true,
      fixed: true,
      width: 220,
    },
    {
      label: '账号昵称',
      prop: 'appUserName',
      overHidden: true,
      width: 140,
      type: 'select',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      dicUrl: `/app/appuser/list/?name={{key}}`,
      props: {
        label: 'nickname',
        value: 'userId',
      },
      dicQuery: {
        type: CUSTOMER_TYPE.BASE_ACCOUNT,
      },
    },
    {
      label: '开业日期',
      prop: 'openDate',
      type: 'date',
      search: true,
      width: 120,
      searchType: 'daterange',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      row: true,
      searchSpan: 8,
      span: 12,
    },
    {
      label: '营业时间',
      prop: 'businessTime',
      row: true,
      span: 24,
      hide: true,
      maxlength: 100,
      type: 'textarea',
      minRows: 7,
      showWordLimit: true,
      rules: [
        {
          required: true,
          message: '请输入营业时间',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '云认养短信通知手机号',
      prop: 'cloudPhone',
      maxlength: 11,
      row: true,
      fixed: true,
      width: 180,
      overHidden: true,
      span: 12,
      rules: [
        {
          required: true,
          min: 11,
          max: 11,
          message: '请输入云认养短信通知手机号',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '宠物总数',
      prop: 'totalCount',
      addDisplay: false,
      viewDisplay: false,
      width: 120,
      row: true,
      editDisplay: false,
      span: 12,
    },
    {
      label: '待领养数',
      prop: 'unAdoptCount',
      addDisplay: false,
      viewDisplay: false,
      row: true,
      width: 120,
      editDisplay: false,
      span: 12,
    },
    {
      label: '已领养数',
      prop: 'adoptCount',
      addDisplay: false,
      viewDisplay: false,
      width: 120,
      row: true,
      editDisplay: false,
      span: 12,
    },
  ],
  group: [
    {
      label: '爱心收容站简介',
      prop: 'introductionGroup',
      arrow: false,
      labelWidth: 0,
      column: [
        {
          placeholder: '请输入爱心收容站简介',
          prop: 'introduction',
          type: 'textarea',
          maxlength: 100,
          minRows: 7,
          showWordLimit: true,
          rules: [
            {
              required: true,
              message: '请输入爱心收容站简介',
              trigger: 'blur',
            },
          ],
        },
      ],
    },
  ],
};
